/*
 * @Description: 首页
 * @Autor: gufuyan
 * @Date: 2021-11-12 09:54:19
 * @lastModifiedBy: gufuyan
 * @LastEditTime: 2021-11-30 09:38:22
 * @lastModifiedContent:
 */
import { request } from 'umi';

import request1 from '@/services/umiRequest';
import type { IPageList } from './data';

/**
 * 登录
 */
export async function Login(): Promise<API.IResponsePage<IPageList[]>> {
  // return request1.get('/bpm/api/user/info');
  return request('/bpm/api/user/info?userId=9346', {
    method: 'GET',
  });
}

/**
 * 初始化查询配置的页面
 */
export async function getPageList(): Promise<API.IResponsePage<IPageList[]>> {
  return request1.get('/bpm/api/from/list');
}

/**
 * 删除
 */
export async function deleteForm(id: number): Promise<API.IResponsePage<IPageList[]>> {
  return request1.get(`/bpm/api/from/delete?id=${id}`);
}

/**
 * 新增
 */
export async function addForm(params: any): Promise<any> {
  // return request1.post(`/bpm/api/from/add`, params);
  request('/bpm/api/from/add', {
    method: 'POST',
    data: JSON.stringify(params),
    headers: {
      Accept: 'application/json, text/plain',
      'Content-Type': 'application/json',
    },
  });
}

/**
 * 修改
 */
export async function updateForm(params: any): Promise<any> {
  request('/bpm/api/from/updata', {
    method: 'POST',
    data: JSON.stringify(params),
    headers: {
      Accept: 'application/json, text/plain',
      'Content-Type': 'application/json',
    },
  });
}

// export async function getList(params: IParams): Promise<IResponsePage<TableListItem[]>> {
//   // return POST(`/api/v1/mock/social_security_transfer/list`, params);
// }
